#include "Class/Manager/Input.hpp"

namespace		Manager
{
  bool					Input::IsKeyDown(::Input::Key::Code c) const throw()
  {
	static int	ct = ::Input::Key::Count;

	return (c < ct && (this->_keyState[c] == ::Input::Pressed || this->_keyState[c] == ::Input::JustPressed));
  }
  ::Input::State	Input::KeyState(::Input::Key::Code c) const throw()
  {
	static int	ct = ::Input::Key::Count;

	if (c < ct)
	  return (this->_keyState[c]);
	return (::Input::NotPressed);
  }
  float				Input::KeyDownTime(::Input::Key::Code c) const throw()
  {
	static int	ct = ::Input::Key::Count;

	if (c < ct)
	  return (this->_keyTime[c]);
	return (.0f);
  }

  bool				Input::IsMouseButtonDown(::Input::Mouse::Button b) const throw()
  {
	static int	ct = ::Input::Mouse::ButtonCount;

	return (b < ct && (this->_mouseState[b] == ::Input::Pressed || this->_mouseState[b] == ::Input::JustPressed));
  }
  ::Input::State	Input::MouseButtonState(::Input::Mouse::Button b) const throw()
  {
	static int	ct = ::Input::Mouse::ButtonCount;

	if (b < ct)
	  return (this->_mouseState[b]);
	return (::Input::NotPressed);
  }
  float				Input::MouseButtonDownTime(::Input::Mouse::Button b) const throw()
  {
	static int	ct = ::Input::Mouse::ButtonCount;

	if (b < ct)
	  return (this->_mouseTime[b]);
	return (.0f);
  }
}
